package com.sline.day01.jdbc;

import org.junit.Test;

import java.sql.Connection;
import java.sql.DriverManager;

public class Demo1_ConnectionTest {
    public static void main(String[] args) throws Exception {
        getConnection();
    }

    @Test
    public static void getConnection() throws Exception {
        // 1.加载注册驱动
        Class.forName("com.mysql.jdbc.Driver");

        // 2.获取连接对象
        Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/jdbcdemo", "root", "admin");

        Thread.sleep(5000);
    }
}
